<!DOCTYPE html>
<html lang="en" >
<head>
    <meta charset="UTF-8">
    <title>EventBind</title>
    <style>
        .red{
            color: red;
        }
    </style>
</head>

<body>
<div id="app">
    <!--  为href属性动态绑定属性值  -->
    <a v-bind:href="url">百度</a>
    <div :class="{red : isRed}">动态绑定class</div>
    <button @click="isRed = !isRed">切换</button>
</div>
<script src="../js/vue.js" ></script>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            url: 'https://www.baidu.com',
            isRed: false
        },
        methods: {

        }
    })
</script>
</body>

</html>